{extend name="../../admin/view/main"}

{block name='content'}
<form action="{:sysuri()}" class="layui-form layui-card" data-auto="true" method="post">
    <div class="layui-card-body" id="app">

        <div class="layui-row">
            <div class="layui-col-xs4">
                


                {notempty name='cateorys'}
                <div class="layui-form-item relative block">
                    <span class="color-green font-w7 label-required-prev">种类</span>
                    <select name="category" class="layui-select" disabled lay-search>
                        {foreach $cateorys as $k=>$v}
                        {if isset($vo.category) and $vo.category eq $v.code}
                        <option selected value="{$v.code}">{$v.name}</option>
                        {else}
                        <option value="{$v.code}">{$v.name}</option>
                        {/if}
                        {/foreach}
                    </select>
                </div>
                {/notempty}

                <label class="layui-form-item relative block">
                    <span class="color-green font-w7">总重量(斤)</span>
                    <input class="layui-input" name="total_weight" type="number" placeholder="请输入" disabled value='{$vo.total_weight|default=""}'>
                </label>
                <label class="layui-form-item relative block">
                    <span class="color-green font-w7">总件数</span>
                    <input class="layui-input" name="total_num" type="number" placeholder="请输入" disabled value='{$vo.total_num|default=""}'>
                </label>
               

                {notempty name='warehouses'}
                <div class="layui-form-item relative block">
                    <span class="color-green font-w7 label-required-prev">出发地</span>
                    <select name="depart_code" class="layui-select" disabled required lay-search>
                        <option value="">请选择</option>
                        {foreach $warehouses as $k=>$v}
                        {if isset($vo.depart_code) and $vo.depart_code eq $v.ware_code}
                        <option selected value="{$v.ware_code}">{$v.ware_name}</option>
                        {else}
                        <option value="{$v.ware_code}">{$v.ware_name}</option>
                        {/if}
                        {/foreach}
                    </select>
                </div>
                {/notempty}
                
                
                
                {notempty name='warehouses'}
                <div class="layui-form-item relative block">
                    <span class="color-green font-w7 label-required-prev">目的地仓库</span>
                    <select name="receiver_code" class="layui-select" disabled required lay-search>
                        <option value="">请选择</option>
                        {foreach $warehouses as $k=>$v}
                        {if isset($vo.receiver_code) and $vo.receiver_code eq $v.ware_code}
                        <option selected value="{$v.ware_code}">{$v.ware_name}</option>
                        {else}
                        <option value="{$v.ware_code}">{$v.ware_name}</option>
                        {/if}
                        {/foreach}
                    </select>
                </div>
                {/notempty}

                <label class="layui-form-item relative block">
                    <span class="color-green font-w7">车牌号</span>
                    <input class="layui-input" name="car_number" type="text" placeholder="请输入" disabled value='{$vo.car_number|default=""}'>
                </label>
                <label class="layui-form-item relative block">
                    <span class="color-green font-w7">备注</span>
                    <textarea class="layui-textarea" name="remark" placeholder="请输入"
                        >{$vo.remark|default=''}</textarea>
                </label>
            </div>
            <div class="layui-col-xs8">
                <div class="grid-demo" style="margin-left: 20px;">
                    

                    <table class="layui-table">
                        <colgroup>
                            <col width="150">
                            <col width="150">
                            <col>
                        </colgroup>
                        <thead>
                            <tr>
                                <th>等级ee</th>
                                <th>重量(斤)</th>
                                <th>件数</th>
                                <th>散件重量</th>
                                <th>总重</th>
                                {if session('user.usertype') eq 1} 
                                <th>价格(¥)</th>
                                <th>金额(¥)</th>
                                {/if}
                            </tr>
                        </thead>
                        <tbody>


                            {empty name='details'}
                            {foreach $levels as $item}

                            <tr>
                                <td>
                                    {$item.name}
                                    <input class="layui-input" type="hidden" name="level_code[]" value="{$item.code}" />
                                    <input class="layui-input" type="hidden" name="level_name[]" value="{$item.name}" />
                                </td>
                                <td>
                                    <input class="layui-input" type="text" name="weight[]" disabled
                                        placeholder="请输入重量" />
                                </td>
                                <td>
                                    <input class="layui-input" type="number" v-model="" name="num[]" disabled placeholder="请输入件数" />
                                </td>
                                <td>
                                    <input class="layui-input" type="number" v-model="" name="other_weight[]" disabled placeholder="请输入" />
                                </td>
                                <td>
                                    <input class="layui-input" type="number" v-model="" name="gross_weight[]" disabled placeholder="请输入" />
                                </td>
                                

                                {if session('user.usertype') eq 1}
                                <td>
                                    <input class="layui-input" type="text" name="unit_price[]" disabled
                                        placeholder="请输入价格" />
                                </td>
                                <td>
                                    <input class="layui-input" type="text" name="price[]" disabled
                                     placeholder="请输入金额" />
                                </td>
                                {/if}
                            </tr>
                            {/foreach}
                            {/empty}

                            {notempty name='details'}
                                {foreach $details as $item}
                                
                                <tr>
                                    <td>
                                        {$item.level_name}
                                        <input class="layui-input" type="hidden" name="level_code[]" value="{$item.level_code}" />
                                        <input class="layui-input" type="hidden" name="level_name[]" value="{$item.level_name}" />
                                    </td>
                                    <td>
                                        <input class="layui-input" type="number" name="weight[]" value="{$item.weight}" disabled placeholder="请输入重量" />
                                    </td>
                                    <td>
                                        <input class="layui-input" type="number" v-model="" name="num[]" value="{$item.num}" disabled placeholder="请输入件数" />
                                    </td>
                                    <td>
                                        <input class="layui-input" type="number" v-model="" name="other_weight[]" value="{$item.other_weight}" disabled placeholder="请输入" />
                                    </td>
                                    <td>
                                        <input class="layui-input" type="number" v-model="" name="gross_weight[]" value="{$item.gross_weight}" disabled placeholder="请输入件数" />
                                    </td>
                                  
                                    {if session('user.usertype') eq 1}
                                    <td>
                                        <input class="layui-input" type="number" name="unit_price[]" value="{$item.unit_price}" disabled placeholder="请输入价格" />
                                    </td>
                                    <td>
                                        <input class="layui-input" type="number" name="price[]" value="{$item.price}" disabled placeholder="请输入金额" />
                                    </td>
                                    {/if}
                                </tr>
                                {/foreach}
                            {/notempty}
                        </tbody>
                    </table>

                    <!-- <div class="layui-form-item">
                        <div class="help-label"><b>签收状态</b></div>
                        <div class="layui-textarea help-checks">

                            
                            <label class="think-checkbox">

                                <input type="radio" {if isset($vo.status) and $vo.status eq 1} checked {/if}  name="status" value="0" lay-ignore> 未收到
                                
                                <input type="radio" {if isset($vo.status) and $vo.status eq 2} checked {/if} name="status" value="2" lay-ignore>已收到

                                <input type="radio" {if isset($vo.status) and $vo.status eq 3} checked {/if} name="status" value="3" lay-ignore>确认支付
                                
                            </label>
                        </div>
                    </div> -->
                    
                </div>
            </div>
        </div>



        <div class="hr-line-dashed"></div>
        {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}

        <div class="layui-form-item text-center">
            <button class="layui-btn" type="submit">确认</button>
            <button class="layui-btn layui-btn-danger" data-history-back  type='button'>取消编辑</button>
        </div>
    </div>

</form>

<script>
    
</script>
{/block}